class ChinaMap
  constructor: (container, options)->
    @initOptions options
    @chart = echarts.init(container)
    @chart.setOption(@defOptions)
    window.mychart = @chart
  initOptions: (options)->
    self = @
    @defOptions =
      title:
        show: false
        text: '' #实时地区播放
        x:'center'
        textStyle : color: '#fff'
      backgroundColor: '#1b1b1b'
      color: ['gold','aqua','lime']
      tooltip: trigger: 'item'
      legend:
        show: false
        orient: 'vertical'
        x:'left'
        data: ['china']
        textStyle: color: '#fff'
      toolbox: show: false
      dataRange:
        show: false
        min : 0
        max : 100
        x: "right"
        calculable : true
        color: ['#ff3333', 'orange', 'yellow','lime','aqua']
        textStyle: color:'#fff'
      series: [self.getEmptyData()]
      geoCoord: CITYMAP

  getEmptyData: ->
    series =
      name: 'china'
      type: 'map'
      roam: false,
      hoverable: false,
      mapType: 'china'
      itemStyle:
        normal:
          borderColor:'rgba(100,149,237,1)'
          borderWidth:0.5
          areaStyle: color: '#1b1b1b'
      data: []
      geoCoord: CITYMAP
      markLine:
        smooth:false
        effect:
          loop: false
          show: true
          scaleSize: 2.5
          period: 15
          shadowBlur: 10
        data : []
      markPoint:
        symbol:'emptyCircle'
        symbolSize : 10 #(v)-> 10 + v/10
        effect :
          loop: false
          show: true
          shadowBlur : 0
        data: []


globalDefined "ChinaMap", ChinaMap